home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 January / macformat-033.iso / mac / Shareware City / Developers / ABox.v1.8 / Header Files / ABUTextBox.h < prev   
Encoding:
C/C++ Source or Header  |  1995-05-23  |  3.4 KB  |  132 lines  |  [TEXT/MMCC]

  1. /*    
  2.     Copyright © 1991-1995 by TopSoft Inc.  All rights reserved.
  3.  
  4.     You may distribute this file under the terms of the TopSoft
  5.     Artistic License, accompanying this package.
  6.     
  7.     This file was developed by George (ty) Tempel in connection with TopSoft, Inc..
  8.     See the Modification History for more details.
  9.  
  10.     This file is based upon code developed by Bryan K. Ressler (Beaker) 
  11.     of Apple DTS as a replacement for TextBox
  12.     
  13.  
  14. Product
  15.     About Box
  16.  
  17. FILE
  18.     ABUTextBox.h
  19.  
  20. NAME
  21.     ABUTextBox.h, part of the ABox project source code,
  22.     a utility class, mixed into other classes, responsible for 
  23.     handling the AboutBox TextBox stuff.
  24.  
  25. DESCRIPTION
  26.     This file contains defines for the about box modules.
  27.     
  28. DEVELOPED BY
  29.     George (ty) Tempel                netromancr@aol.com
  30.     All code in this file, and its associated header file was
  31.     Created by George (ty) Tempel in connection with the TopSoft, Inc.
  32.     "FilterTop" application development, except where noted.
  33.  
  34.     This file is based upon code developed by Bryan K. Ressler (Beaker) 
  35.     of Apple DTS as a replacement for TextBox
  36.     
  37.  
  38. CARETAKER - George (ty) Tempel <netromancr@aol.com>
  39.      Please consult this person for any changes or suggestions to this file.
  40.  
  41. MODIFICATION HISTORY
  42.  
  43.     dd mmm yy    -    xxx    -    patchxx: description of patch
  44.     9 June 94    -    ty    -    Initial Version Created
  45.     20-july-94    -    ty    -    initial version released
  46.     23-may-95    -    ty    -    changes for compatibility with the CodeWarrior CW6
  47.                             release and the associated Universal Headers from Apple:
  48.                             most methods that returned references now have "Ref" at
  49.                             the end of their methods names to prevent possible collisions
  50.                             with datatypes and classes of the same name (older versions
  51.                             of the compiler didn't have a problem with this).
  52.  
  53. */
  54.  
  55. /*===========================================================================*/
  56.  
  57. /*========== Exclusion Macros ============*/
  58.  
  59. #pragma    once
  60.  
  61. #ifndef    _ABUTextBox_
  62. #define    _ABUTextBox_
  63.  
  64. /*============ Header Files ==============*/
  65.  
  66. #include    "ABoxDefs.h"
  67.  
  68. /*=========== External Linkage ===========*/
  69.  
  70. /*============== Constants ===============*/
  71.  
  72. #define kNTBJustFull        128            //    Full justification
  73. #define kNTBReturnChar        0x0d        //    Carriage return character
  74.  
  75.  
  76. #define kNTBTrueTypeTrap    0x54        //    The TrueType trap number
  77.  
  78. /*================ Macros ================*/
  79.  
  80. #define MAXOF(a,b)    (((a) > (b)) ? (a) : (b))
  81.  
  82. #define    gHasTrueType  (Boolean)(NGetTrapAddress(kNTBTrueTypeTrap,ToolTrap) != NGetTrapAddress(kABUnimplTrap,ToolTrap))
  83.  
  84.  
  85. /*================ Enums =================*/
  86.  
  87. /*=============== Structs ================*/
  88.  
  89. /*=============== Typedefs ===============*/
  90.  
  91.  
  92. /*=========== Class Definitions ==========*/
  93.  
  94. class    ABUTextBox
  95. {
  96.     public:
  97.                         ABUTextBox(void);
  98.         virtual            ~ABUTextBox(void);
  99.     
  100.         static        OSErr    DrawTextBox (unsigned char *theText, 
  101.                                         unsigned long textLen, 
  102.                                         Rect *box,
  103.                                         short just, 
  104.                                         short htCode, 
  105.                                         short *endY, 
  106.                                         short *lhUsed);
  107.     protected:
  108.         
  109.         static    unsigned short NTBLineHeight(unsigned char *theText, 
  110.                                         unsigned long textLen,
  111.                                         Rect *wrapBox, 
  112.                                         short lhCode, 
  113.                                         short *startY);
  114.                                         
  115.         static    void             NTBDraw(StyledLineBreakCode breakCode, 
  116.                                         unsigned char *lineStart,
  117.                                         long lineBytes, 
  118.                                         Rect *wrapBox, 
  119.                                         short align, 
  120.                                         short curY, 
  121.                                         short boxWidth);
  122.  
  123.     private:
  124. };
  125.  
  126.  
  127. /*========== Function Prototypes =========*/
  128.  
  129.  
  130. #endif    // _ABUTextBox_
  131.  
  132.